package com.dzl.shoppingCart.dao;

import com.dzl.base.mapper.BaseMapper;
import com.dzl.shoppingCart.pojo.WelfareUserShoppingCart;
import com.dzl.shoppingCart.pojo.query.WelfareUserShoppingCartQuery;
import com.dzl.shoppingCart.pojo.vo.WelfareUserShoppingCartSupplierListVo;
import com.dzl.shoppingCart.pojo.vo.WelfareUserShoppingCartVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 小程序用户购物车(WelfareUserShoppingCart)表数据库访问层
 * @author ChenLong
 * @since 2021-05-20 11:33:07
 */
public interface WelfareUserShoppingCartMapper extends BaseMapper<WelfareUserShoppingCart> {

    /**
     * 删除购物车商品
     * @param id id 购物车id
     * @param userId 用户id
     * @return boolean
     * @author ChenLong
     * @since 2021-05-20 14:26:03
     **/
    Integer deleteById(@Param("id") Integer id,@Param("userId") Integer userId);

    /**
     * 批量删除购物车商品
     * @param idList id列表
     * @return int
     * @author ChenLong
     * @date 2021-06-07 17:41:25
     **/
    Integer deleteBatchByIdList(@Param("list") List<Integer> idList,@Param("userId") Integer userId);

    /**
     * 获取用户购物车商品信息
     * @param query 购物车查询条件
     * @return java.util.List
     * @author ChenLong
     * @since 2021-05-20 14:26:20
     **/
    List<WelfareUserShoppingCartVo> getUserCartGoodsList(WelfareUserShoppingCartQuery query);

    /**
     * 获取用户购物车商品信息(以供应商纬度分组)
     * @param query 购物车查询条件
     * @return java.util.List
     * @author ChenLong
     * @since 2021-05-20 14:26:20
     **/
    List<WelfareUserShoppingCartSupplierListVo> getUserCartGoodsListGroupBySupplier(WelfareUserShoppingCartQuery query);

    /**
     * 获取用户购物车选择的商品信息(以供应商纬度分组)
     * @param list 购物车id的list
     * @return java.util.List
     * @author ChenLong
     * @since 2021-05-20 14:26:20
     **/
    List<WelfareUserShoppingCartSupplierListVo> getUserCartGoodsListGroupBySupplierByIdList(@Param("list") List<Integer> list);
}

